package system.model.converter;

import common.model.po.SysTopic;
import system.model.request.SaveTopicRequest;

/**
 * 在此填写类的用途、注意事项等
 *
 * @author 米泽鹏
 * @since 2021-08-08 下午 8:41
 */
public class SysTopicConverter {

	public static SysTopic saveRequestToPo(SaveTopicRequest saveTopicRequest) {
		if (saveTopicRequest == null) {
			return null;
		}
		SysTopic sysTopic = new SysTopic();
		sysTopic.setUserId(saveTopicRequest.getUserId());
		sysTopic.setNickname(saveTopicRequest.getNickname());
		sysTopic.setType(saveTopicRequest.getType());
		sysTopic.setTitle(saveTopicRequest.getTitle());
		sysTopic.setContent(saveTopicRequest.getContent());
		sysTopic.setIsClosed(saveTopicRequest.getIsClosed());
		sysTopic.setSort(saveTopicRequest.getSort());
		sysTopic.setId(saveTopicRequest.getId());
		return sysTopic;
	}

}
